Table of Contents
mIRC DDE FAQ

Version 1 Revision 2

This is a quick reference for mIRC 3.92's Direct Data Exchange server. This is a supplemental to Tjerk Vonck's excellent mIRC FAQ #23. The next version of the FAQ should include a section on DDE;

until then you may use this document.

Introduction

What is DDE?

Xtype_POKE Topics

Xtype_Request Topics

Getting started

Setting up a DDE Server

DDE Topics and Examples of usage

DDE Topics

Known Problems with DDE  and other notes

Notes

Acknowledgements

A Word Of Thanks

How To Contact The Author

Corrections , Clarification, Ect

Legal info

CopyRight


Introduction
What is DDE?

DDE stands for Direct Data Exchange. DDE is a means for "client" and "server"
DDE programs to exchange different data types. The best example of this is the
clipboard, which uses the control-C function to transfer data such as text or
graphics, to its "buffer.” Programmers frequently use DDE to exchange data with
external applications. An example in mIRC is the URL catcher which uses DDE
when it launches your specified web browser.

mIRC can act as both a server and a client; making data available to other programs
or by receiving requests.

See also

Xtype_Poke

Xtype_Request


DDE Server Setup
Setting up a DDE Server

Setting up a DDE server is as easy as choosing a name and typing a command

/ddeserver on|off Name

example:

/ddeserver on Prophet

this would turn on my dde server with the sever name Prophet

A Second DDE Server....

If you have a second copy of mIRC running , it might be useful to set up
its' DDE server as well. You can then make an alias to control it in your
first copy, like:

/hjoin /dde hal-9x command "" /join $#?="channel to join"

this will be explained further in

mIRC DDE TOPICS


Xtype_Request

An Xtype_Request is any topic that "request " data from mIRC
via its DDE SERVER.  mIRC uses a variable $DDE to Represent that data.
all xtype_request topics are called from within an alias.

a few examples:
/chans /say $me is currently on $dde hal-9x channels ""

/dusers /say  users on $dde Prophet users #mirc

See Also

DDE Server Setup


Xtype_Poke

A Topic that ask mIRC to do a certain task via its; DDE SERVER
is called an Xtype_poke.

Currently only one xtype_poke topic, the COMMAND  topic exists in mIRC.

the command topic is similar to mIRC's remote event command
DO:
it will execute whatever you tell it to via DDE. The command topic is used
in conjuction with the mIRC /dde command-line
here are a few examples:

/dde Hal-9x command "" /join #mirc
/dde Prophet command "" /msg #mirc hello everyone

the command topic can be used in the Remote events and commands Section, and the Alias section (explained later)

See Also

Xtype_Request


Topics Currently Supported
DDE Topics in mIRC

This section is not intended to be a complete reference to DDE in mIRC (see the
mIRC help file for technical information by typing /help dde commands). Instead, it
will focus on syntax through examples of usage.

COMMAND TOPIC
==============
This allows mIRC to control a second client similar to the remote CTCP DO
command (refer to the help file or FAQ if you are unfamiliar with the remote
section).

In the following examples, PROPHET will be the server name and HAL-9X the
client. Replace them with the appropriate names for your own use.

A few examples:

from the command line:

/dde HAL-9X command "" /join #mirc
this will cause the server known as HAL-9X to join the channel #mIRC.

/dde HAL-9X command "" /quit
this will cause the server HAL-9X to disconnect from the IRC server.

from an alias:

/cmsg /dde HAL-9X command "" /msg #mirc *1
this alias is used by the PROPHET server to make the HAL-9X client msg
the #mIRC channel with the specified text.

/hjoin /dde HAL-9X command "" /join #$1
This alias is used by the PROPHET server to make the HAL-9X client join
the specified channel.

in a remote event
1:on join:#:/dde PROPHET command "" /echo 3  -=Joins=- $chan $nick
In this example, whenever a user joins a channel, HAL-9X will react by
sending PROPHET the message “-=joins=- #channel nickname” to the active
window. If residue joins #mirc, HAL-9X would then send the following
information to PROPHET: -=joins=- #mirc Residue

The above event can be useful by allowing you to monitor another channel without
having that copy of mIRC open on your desktop.

other examples:

1:on text:*:#:/dde PROPHET command "" /echo 3 < $chan > -= $nick =-
[ $parms ]
When text is spoken in any channel HAL-9X is on, HAL-9X will react
by sending the server, Prophet,  < #channel > -= Nickname =- [text]

If Ducky types "you can get mIRC 3.92 at http://www.bcn.net/~jfudge" on #mIRC
HAL-9X would react to this by sending :

< #mirc > -= Ducky =- [you can get mIRC at http://www.bcn.net/~jfudge]
With a bit of tinkering, COMMAND can be very useful in relaying
information, as well as manipulating, to a second client.

Section 4: Other Topics
================
There are all kinds of ways to use the other topics, and what follows are
a few examples, with a brief discussion of how they work. This is not to
be considered the only possible way to use these topics, but merely a sample
of what can be accomplished with DDE.

CHANNELS TOPIC
==============
the CHANNELS topic is an Xtype_Request which returns a single line of
text containing the current channels the dde server is on. This command can be
used from the command line, an alias, or a remote.

Alias:

/channels /echo 3 I am currently on $dde HAL-9X CHANNELS ""
If HAL-9X was currently on #mIRC, #mIRCbeta, #Dragonrealm,
this alias would return :

I am currently on #Dragonrealm #Mircbeta #mIRC

/chan /write chan.txt HAL-9X is currently in $dde HAL-9X CHANNELS ""
This alias writes the current channels HAL-9X is in to a file called chan.txt.

Many of the other DDE topics will work similarly.

CONNECTED TOPIC
================
This command returns a single line of text with "connected", if connected,
"connecting", if connecting, and finally "not connected", if you are not
connected to a server.

Alias:

/connect /echo 3 mIRC is currently $dde HAL-9X connected ""  to a server
If you were not connected this would return  :

mIRC is currently not connected to a server

EXENAME TOPIC
=============
This returns the path and  name of your current mIRC client.

Alias:

/exe /echo 3 the mIRC exe name path and filename is $dde HAL-9X exename ""
If the path and filename were d:\mirc\utils\mirc2.exe this would return:

the mIRC exename path and filename is d:\utils\mirc\mirc2.exe

INIFILE TOPIC
==========
Returns the name of the current client’s ini file (including the path).

Alias:

/echo 3 mIRC’s ini file is $dde HAL-9X inifile ""

If the ini was called mirc2.ini in the d:\utils\mirc\ini2 directory, this would
return:

mIRC’s ini file is d:\utils\mirc\ini2\mirc2.ini

USERS TOPIC
===========
This returns a listing of users and the channel name (you must be in the channel).

Alias:

/dusers /echo 3 Users on $dde HAL-9X #mirc

If HAL-9X were on #mirc, and Prophet, Ducky, residue, and Despayre were also
on #mIRC, the following would be displayed:

Users on #mirc @Prophet @Ducky @Hal-9X @residue Despayre

Note: Channel operators will be denoted by an @, consistent with a channel listing
of users..

/wusers /write users.txt Users on $dde HAL-9X users #mirc
This alias will perform the same function as the previous example but will write the
output to a text file called users.txt instead of echoing the information.

SERVER TOPIC
============
This will  return the name of the server to which you were last connected or the
server to which you are currently connected.

Alias:

/serv /echo 3  I was connected, or am currently connected to $dde HAL-9X
server ""

If HAL-9X were connected to irc.dal.net, this would return:

I was connected, or am currently connected to irc.dal.net

NICKNAME TOPIC
==============
This returns the current nickname.

Alias:

/name /echo 3 my current nickname is $dde HAL-9X nickname ""
If the nickname of the client was Smashy, this would return:

my current nick name is Smashy

VERSION TOPIC
=============
This command returns either "mIRC16 3.92" or "mIRC32 3.92"

Alias:

/version /echo 3 My current version is $dde HAL-9X version ""
If you were using mIRC 3.92 32 bit version this would return:

My current version is mIRC32 3.92


Other Notes

In Version 3.92 you may encounter Lockups, Gpf's (general protection faults)
and other fun stuff When using the Remote events and commands.
Most errors can be traced back to sloppy dde sytax! (such as leaving a " out
of a command. it should also be noted that mIRC, by default, leaves the dde
server set to off . Make sure that you activate the dde server by typing

/ddeserver on SERVERNAME

If running two instances of mIRC make sure not to leave the default names
mirc the same on both servers. this will cause mIRC to crash.

The Author makes no claims that this function will work, and takes no
responsibility for system crashes, locked systems, lost files, or any other
damage resulting from mIRC......


Contacting The Author

 You are encouraged to contact me with any questions, comments  or corrections at jfudge@adams.berk.net
 or find me on the #mirc channel on Efnet or Dalnet

 You can always find the latest version of this , and other
  informational files for mIRC at:

 Http://adams.berk.net/~jfudge/index.html


Acknowledgements

This Document would not have been possible without the help of
Residue from #mIRC on EFnet. His proficency in mIRC , as well as his
kindness and encouragement  have made this document what it is.

And thanks to Johno, whose examples cleared the way to understanding.

And to Ducky, who asked " what do you know about DDE? "

  Thank You fellow oppers


Copyright Information
Copyright

This document and its contents may not be altered in any shape or form, without written consent from the author, but may be copied for the purpose of distrobution. This document may not be included in any other document, except the mIRC FAQ -should its author feel the need to do so.

                                  (C) NightShade DTP 1996